/*
 *  ADataManager.cpp
 *  Amano Engine
 *
 *  Created by Aurelien Serandour on 10/03/11.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */

#include "../include/ADataManager.h"

using namespace Amano;

ADataManager* ADataManager::m_dataManagerInstance = NULL;

ADataManager* ADataManager::Singleton()
{
	if (!m_dataManagerInstance)
	{
		m_dataManagerInstance = new ADataManager;
	}
	return m_dataManagerInstance;
}

ADataManager::ADataManager(){}

ADataManager::~ADataManager()
{
	for (AShaderLibrary::iterator it = m_shaderList.begin(); it != m_shaderList.end(); it++)
	{
		delete (it->second);
	}
	m_shaderList.clear();
	m_shaderCount.clear();
	
	for (AMeshLibrary::iterator it = m_meshList.begin(); it != m_meshList.end(); it++)
	{
		delete (it->second);
	}
	m_meshList.clear();
	m_meshList.clear();
}